<template>
  <!--枚举管理-->
  <basic-container>
    <div>
      <m-s-search :list="OSSManageOption.column" @searchClick="v=>{queryForm=v,page.currentPage=1,getList()}"></m-s-search>
    </div>
    <avue-crud :option="OSSManageOption"
               :table-loading="loading"
               :data="data"
               @selection-change="v=>selection=v"
               @current-change="currentChange"
               @size-change="sizeChange"
               ref="crud"
               :page.sync="page">
      <template slot="menuLeft" slot-scope="{size}">
        <el-button :size="size" type="primary"
                   @click="addToTabsList('OSS',{oid:-1},'OSSManageTemp','add')">创建
        </el-button>
        <el-button :size="size" type="danger" @click="remove(selection)" :disabled="selection.length===0">删除
        </el-button>
      </template>

      <template slot="name" slot-scope="{row}">
        <div class="column-btn" @click="addToTabsList(row.name+'OSS',row,'OSSManageTemp','view')">
          {{ row.name }}
        </div>
      </template>

      <template slot="menu" slot-scope="{row}">
        <el-button type="text" @click="addToTabsList(row.name+'OSS',row,'OSSManageTemp','view')">查看详情
        </el-button>
        <el-button type="text" @click="addToTabsList(row.name+'OSS',row,'OSSManageTemp','edit')">修改
        </el-button>
      </template>
    </avue-crud>

    <ms-drawer @refresh="getList()" :visible.sync="visible" :tab-list.sync="tabsList"></ms-drawer>

  </basic-container>
</template>
<script>
import MSSearch from "@/DMDComponents/MSSearch.vue";
import commonJs from "../../util/commonJs"

export default {
  name: "OSSManage",
  components: {MSSearch},
  inject: ["OSSManageOption"],
  mixins: [commonJs],
}
</script>
